From abd56027c8aa2e5bad40a335d035e3ac6cc16c54 Mon Sep 17 00:00:00 2001 From: Roan Kattouw Date: Tue, 14 Oct 2008 12:46:11 +0000 Subject: [PATCH] (bug 15945) API: Use User::useRCPatrol() and useNPPatrol() rather than isAllowed('patrol') in list=recentchanges --- RELEASE-NOTES | 2 ++ includes/api/ApiQueryRecentChanges.php | 6 +++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index b5cf6a145e..bac626d4a8 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -325,6 +325,8 @@ The following extensions are migrated into MediaWiki 1.14: manipulation of legacy pages with invalid titles possible * (bug 15881) Empty or invalid parameters cause database errors * The maxage and smaxage parameters are now properly validated +* (bug 15945) list=recentchanges doesn't check $wgUseRCPatrol, $wgUseNPPatrol + and patrolmarks right === Languages updated in 1.14 === diff --git a/includes/api/ApiQueryRecentChanges.php b/includes/api/ApiQueryRecentChanges.php index 81c3680059..6f87dff530 100644 --- a/includes/api/ApiQueryRecentChanges.php +++ b/includes/api/ApiQueryRecentChanges.php @@ -67,7 +67,7 @@ class ApiQueryRecentChanges extends ApiQueryBase { public static function getPatrolToken($pageid, $title, $rc) { global $wgUser; - if(!$wgUser->isAllowed('patrol')) + if(!$wgUser->useRCPatrol() && !$wgUser->useNPPatrol()) return false; // The patrol token is always the same, let's exploit that @@ -138,7 +138,7 @@ class ApiQueryRecentChanges extends ApiQueryBase { // Check permissions global $wgUser; - if((isset($show['patrolled']) || isset($show['!patrolled'])) && !$wgUser->isAllowed('patrol')) + if((isset($show['patrolled']) || isset($show['!patrolled'])) && !$wgUser->useRCPatrol() && !$wgUser->useNPPatrol()) $this->dieUsage("You need the patrol right to request the patrolled flag", 'permissiondenied'); /* Add additional conditions to query depending upon parameters. */ @@ -183,7 +183,7 @@ class ApiQueryRecentChanges extends ApiQueryBase { $this->fld_loginfo = isset($prop['loginfo']); global $wgUser; - if($this->fld_patrolled && !$wgUser->isAllowed('patrol')) + if($this->fld_patrolled && !$wgUser->useRCPatrol() && !$wgUser->useNPPatrol()) $this->dieUsage("You need the patrol right to request the patrolled flag", 'permissiondenied'); /* Add fields to our query if they are specified as a needed parameter. */ -- 2.20.1